//
//  LKAnalyticesAction.h
//  LKAnalytics
//
//  Created by Eric MiAo on 16/9/7.
//  Copyright © 2016年 MiAo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "LKAnalyticesNotificationController.h"


typedef enum {
    REALTIME NS_DEPRECATED_IOS(1, 1, "暂不支持") = 0,       // 实时发送              (not avilable, will be support later)
    BATCH = 1,          // 启动发送              (default)
    SEND_INTERVAL = 6,  // 最小间隔发送           ([90-86400]s, default 90s)
    
    // deprecated strategy:
    SENDDAILY = 4,      // 每日发送
    SENDWIFIONLY = 5,   // 仅在WIFI下时启动发送
    SEND_ON_EXIT = 7    // 进入后台时发送
} ReportPolicy;

typedef enum {
    DISTRIBUTION,       // 生产环境
    DEVELOPMENT        // 开发环境
} Operating;

@interface LKAnalyticesAction : NSObject<LKAnalyticesNotificationControllerDelegate>

@property (nonatomic, assign) BOOL isOn;

+ (instancetype)sharedAction;

- (void)developmentEnvironmentWithUrlPrefix:(NSString *)url;
- (void)startWithAppkey:(NSString *)appKey reportPolicy:(ReportPolicy)rp userInfo:(NSString *)userInfo;
- (void)setLogSendInterval:(double)second;
- (void)setLatency:(NSInteger)second;
- (void)logPageView:(NSString *)pageName seconds:(NSInteger)seconds;
- (void)beginLogPageView:(NSString *)pageName;
- (void)endLogPageView:(NSString *)pageName;
- (void)event:(NSString *)eventId label:(NSString *)label attributes:(NSDictionary *)attributes;
- (void)debugModel;
@end
